From: Timm Bäder Date: Sat, 17 Aug 2019 14:12:57 +0000 (+0200) Subject: cssanimatedstyle: Remove some casts in hot paths X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1~1^2~321^2^2~975 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=36a1b69a19358b852ad28092e1d6a67235de66e3;p=gtk4.git cssanimatedstyle: Remove some casts in hot paths gtk_css_animated_style_create_css_transitions down from 16% to 11% when repeatedly clicking on a spinbutton button in the widget factory. --- diff --git a/gtk/gtkcssanimatedstyle.c b/gtk/gtkcssanimatedstyle.c index c09ddb01ce..2b75451840 100644 --- a/gtk/gtkcssanimatedstyle.c +++ b/gtk/gtkcssanimatedstyle.c @@ -195,17 +195,17 @@ transition_info_add (TransitionInfo infos[GTK_CSS_PROPERTY_N_PROPERTIES], { GtkCssStyleProperty *prop = _gtk_css_shorthand_property_get_subproperty (shorthand, i); - transition_info_add (infos, GTK_STYLE_PROPERTY (prop), index); + transition_info_add (infos, (GtkStyleProperty *)prop, index); } } else { guint id; - if (!_gtk_css_style_property_is_animated (GTK_CSS_STYLE_PROPERTY (property))) + if (!_gtk_css_style_property_is_animated ((GtkCssStyleProperty *) property)) return; - id = _gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (property)); + id = _gtk_css_style_property_get_id ((GtkCssStyleProperty *) property); g_assert (id < GTK_CSS_PROPERTY_N_PROPERTIES); infos[id].index = index; infos[id].pending = TRUE; @@ -231,7 +231,7 @@ transition_infos_set (TransitionInfo infos[GTK_CSS_PROPERTY_N_PROPERTIES], for (j = 0; j < len; j++) { - property = GTK_STYLE_PROPERTY (_gtk_css_style_property_lookup_by_id (j)); + property = (GtkStyleProperty *)_gtk_css_style_property_lookup_by_id (j); transition_info_add (infos, property, i); } }